import { getPlaylistAjax } from "@/http/modules/playlist-detail";
const { createSlice, createAsyncThunk } = require("@reduxjs/toolkit");

export const getPlaylistInfo = createAsyncThunk("playlistdetail",async (id)=>{
    const res = await getPlaylistAjax(id);
    return res
})

const hallSlice = createSlice({
    name:"playlist",
    initialState:{
        playlistdetail:[],
    },
    extraReducers:{
        [getPlaylistInfo.fulfilled](state,{payload}){
            state.playlistdetail = payload;
        },
    }
})

export default hallSlice.reducer